﻿using System;
using System.Collections.Generic;
using System.Drawing;
//using System.Linq;
using System.Windows.Forms;

namespace BanHangCshap
{
    //Gấp quá nên viết bừa, sau này sẽ truyền nội dung động + resize động
    public partial class frmThongbaoTimer : Form
    {
        public frmThongbaoTimer()
        {
            InitializeComponent();
        }

        private void frmThongbaoTimer_Resize(object sender, EventArgs e)
        {
            btnDong.Location = new Point((this.Size.Width - btnDong.Size.Width-16) / 2, btnDong.Location.Y);
        }
        int x = 2;

        private void timer1_Tick(object sender, EventArgs e)
        {
            btnDong.Text = "Đóng (" + x.ToString() + ")";
            if (x < 0)
            {
                timer1.Stop();
                this.Close();
            }
            --x;
        }

        private void btnDong_Click_1(object sender, EventArgs e)
        {
            this.Close();
        }             
    }
}
